package com.spring.demo7.eg2;

import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

/**
 * @author vhans
 */
@Component
// 1.和@Component一起用在类上，指定在service1创建之前先创建service2和service3
@DependsOn({"service2", "service3"})
public class Service1 {
    public Service1() {
        System.out.println("create service1");
    }
}
